package com.xbongbong.pro.domain.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * 评分操作实体类
 * eg： 满足某项条件增加10.5分
 * {
 *     “code”:0,
 *     "name":"增加",
 *     “alias”:scoreAdd,
 *     “value”：10.5
 * }
 */
@Data
public class ScoreOperationEntity implements Serializable,Cloneable {
    private static final long serialVersionUID = 3528955007420505116L;

    /**
     * 操作code
     */
    private Integer code;

    /**
     * 操作名称
     */
    private String  name;

    /**
     * 操作别名
     */
    private String  alias;

    /**
     * 操作增量
     */
    private Double value;

    public Double getValue(){
        return Objects.isNull(value) ? 0D :value;
    }

    public ScoreOperationEntity() {
        this.value = 0D;
    }

    public ScoreOperationEntity(Integer code, String name, String alias) {
        this.code = code;
        this.name = name;
        this.alias = alias;
    }

    public ScoreOperationEntity(Integer code, String name, String alias, Double value) {
        this.code = code;
        this.name = name;
        this.alias = alias;
        this.value = value;
    }

}
